package com.demo.demo_mybatis.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.demo.demo_mybatis.entity.User;
import com.demo.demo_mybatis.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author demo
 * @since 2022-03-09
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserMapper userMapper;

    @GetMapping("/find")
    public List<User> find() {
        QueryWrapper<User> qw = new QueryWrapper<>();
        return userMapper.selectList(qw);
    }
}
